<include file="public/layout" />
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>会员管理 - 添加会员</h3>
                <h5>网站系统添加会员</h5>
            </div>
        </div>
    </div>
    <form class="form-horizontal" method="post" id="add_form">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label for="account"><em>*</em>账号</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="account" id="account" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">请填写手机号码</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="nickname"><em>*</em>会员昵称</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="nickname" id="nickname" class="input-txt">
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="password"><em>*</em>登录密码</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="password" id="password" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">请输入6~16位密码, 数字字母符号组合</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="paypassword"><em>*</em>支付密码</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="paypassword" id="paypassword" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">请输入6~16位密码, 数字字母符号组合</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="parentAccount"><em>*</em>推荐人账号</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="parentAccount" id="parentAccount" class="input-txt">
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            <div class="bot"><a href="JavaScript:void(0);" onclick="checkUserUpdate();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
        </div>
    </form>
</div>
<script type="text/javascript">
    function checkUserUpdate(){
        var password = $('input[name="password"]').val();
        var paypassword = $('input[name="paypassword"]').val();
        var nickname = $.trim($('input[name="nickname"]').val());
        var account = $.trim($('input[name="account"]').val());
        var parentAccount = $.trim($('input[name="parentAccount"]').val());
        var error ='';
        if(nickname == ''){
            error += "昵称不能为空\n";
        }
        if(password == ''){
            error += "密码不能为空\n";
        }
        if(password.length<6 || password.length>16){
            error += "密码长度不正确\n";
        }

        if(paypassword&&(paypassword.length<6 || paypassword.length>16)){
            error += "支付密码长度不正确\n";
        }

        if(error){
            layer.alert(error, {icon: 2});  //alert(error);
            return false;
        }
        $('#add_form').submit();
    }
</script>
</body>
</html>